import { fileURLToPath } from 'node:url'
import { mergeConfig, defineConfig, configDefaults } from 'vitest/config'
import viteConfig from './vite.config'

export default mergeConfig(
  viteConfig,
  defineConfig({
    test: {
      environment: 'jsdom',
      exclude: [...configDefaults.exclude, 'e2e/**'],
      root: fileURLToPath(new URL('./', import.meta.url))
    },
    preprocessorOptions: {
      scss: {
        additionalData: `@import @/src/assets/main.css`
      }
    },
    server: {
      proxy: {
        '/api': {
          target: 'http://124.221.74.149:3000/',
          changeOrigin: true,
          rewrite: (path) => path.replace(/^\/api/, '')
        },
      }}
  })
  

)
